#!/bin/bash
# 测试镜像可用性

GIT_CMD="/c/Program Files/Git/bin/git.exe"

echo "=== 测试镜像可用性 ==="
echo

mirrors=(
    "https://gitee.com/mirrors/expat"
    "https://gitee.com/mirrors/zlib"
    "https://gitee.com/mirrors/libpng"
    "https://gitee.com/mirrors/libtiff"
    "https://gitee.com/mirrors/libjpeg-turbo"
)

for mirror in "${mirrors[@]}"; do
    echo -n "测试 $mirror ... "
    if timeout 10 "$GIT_CMD" ls-remote "$mirror" >/dev/null 2>&1; then
        echo "✅ 可用"
    else
        echo "❌ 不可用或超时"
    fi
done
